package com.myidis.mapper;

import com.myidis.entity.FullSLResult;
import com.myidis.entity.IndexResultList;
import com.myidis.entity.SignalQuota;
import com.myidis.entity.SignalThreshold;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;

public interface SignalThresholdMapper {
    @Select("SELECT * FROM signal_threshold where quota = #{quota} and subject = #{subject}")
    @Results({
            @Result(property = "id", column = "id"),
            @Result(property = "blueValue", column = "blueValue"),
            @Result(property = "redValue", column = "redValue"),
            @Result(property = "yellowValue", column = "yellowValue"),
            @Result(property = "greenValue", column = "greenValue"),
            @Result(property = "quota", column = "quota"),
            @Result(property = "subject", column = "subject"),
    })
    SignalThreshold getByQuota(@Param("quota")String quota, @Param("subject") String subject);

    @Select("SELECT * FROM ciresults where listId = #{id}")
    @Results({
            @Result(property = "id", column = "id"),
            @Result(property = "listId", column = "listId"),
            @Result(property = "time", column = "time"),
            @Result(property = "combination", column = "combination"),
            @Result(property = "LeadCI", column = "LeadCI"),
            @Result(property = "CoinCI", column = "CoinCI"),
            @Result(property = "LagCI", column = "LagCI"),
            @Result(property = "BenchmarkCI", column = "BenchmarkCI")
    })
    ArrayList<FullSLResult> getData(IndexResultList sea);

}
